#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
#include <QMouseEvent>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::mousePressEvent(QMouseEvent *event)
{
    if(event->button() == Qt::LeftButton)
    {
        qDebug() << "鼠标左键";
    }
    if(event->button() == Qt::RightButton)
    {
        qDebug() << "鼠标右键";
    }
    if(event->button() == Qt::MidButton)
    {
        qDebug() << "鼠标中键";
    }

}

